

class Aminal {

    public String name = "zhangsan";
    public int age = 10;

    public void eat() {
        System.out.println(this.name + "正在吃饭");
    }

    public void sleep() {
        System.out.println(this.name + "正在睡觉");
    }
}

class Dog extends Aminal{

    public void wook() {
        System.out.println(this.name + "汪汪叫");
    }
}

class Cat extends Aminal {

    public void miao() {
        System.out.println(this.name + "喵喵叫");
    }
}






public class Demo {


    public static void main(String[] args) {
        Dog d = new Dog();
        Cat c = new Cat();

        Aminal aminal = new Dog();

        System.out.println(d.name);

        d.sleep();

        d.name = "lisi";
        d.eat();
        c.eat();
    }

}
